import java.util.Scanner;

public class Main7 {
    public static int get(int n) {
        int ret = 1;
        while(n >= 10) {
            ret *= n % 10;
            n /= 10;
        }
        ret *= n;
        return ret;
    }
    //连的个数
    public static int countLian(int n) {
        int ret = 0;
        if(n < 10) {
            return 0;
        }
        while(n >= 10) {
            int t = get(n);
            n = t;
            ret++;
        }
        return ret;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int index = 0;
        int[] ret = new int[1000];
        int max = 0;
        for (int i = a; i <= b; i++) {
            int k = countLian(i);
            if(k == max) {
                ret[index++] = i;
            } else if (k > max) {
                max = k;
                ret[0] = i;
                index = 1;
            }
        }
        System.out.println(max);
        for (int i = 0; i < index - 1; i++) {
            System.out.printf("%d ", ret[i]);
        }
        System.out.println(ret[index - 1]);
    }
}
